﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WcfServer;

using System.ServiceModel;
using System.Threading;
using System.Net.Sockets;
using System.IO;
using System.Net;

using WcfServer.Classes.Utility;
using WcfServer.Classes.Client;
using Client.ViewModel;
using MahApps.Metro;
using Client.View;

namespace Client
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow 
    {
        static public byte[] ClientServerSessionKey { set; get; }
        public static String CurrentUserName { set; get; }
        private MainPage mainPage = new MainPage();
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Flyouts[0].IsOpen = !Flyouts[0].IsOpen;
        }
        private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                string t = ((sender as ComboBox).SelectedItem as ComboBoxItem).Content.ToString();

                ThemeManager.ChangeTheme(this, ThemeManager.DefaultAccents.FirstOrDefault(s => s.Name.Contains(t)), Theme.Light);


            }
            catch (System.Exception ex)
            {
            }

        }

        private void flyout_MouseLeave(object sender, MouseEventArgs e)
        {
            flyout.IsOpen = false;
        }

        private void MetroWindow_Loaded_1(object sender, RoutedEventArgs e)
        {
            //mainPage.DataContext = new MainViewModel();
            //this.myFrame.Navigate(mainPage);
            this.myFrame.Navigate(new StartPage());
        }
   

        private void Frame_Initialized_1(object sender, EventArgs e)
        {
            myFrame.Navigate(new MainPage());
        }
    }
}
